import type { PatientItem, PatientParams } from "@/types/patient";
import { request } from "@/utils/request";

/**
 * 添加患者
 */
export const addPatientApi = (data: PatientParams) => request.post<null, {id: string}>('/patient/add', data)


/**
 * 获取患者列表
 */
export const patientListApi = () => request.get<null, PatientItem[]>('/patient/mylist')


/**
 * 删除患者（家庭档案）
 */
export const removePatientApi = (id: string) => request.delete(`/patient/del/${id}`)

/**
 * 患者详情（家庭档案）
 */
export const patientDetailApi = (id: string) => request.get<null, PatientItem>(`/patient/info/${id}`)


/**
 * 编辑（更新）患者（家庭档案）
 */
export const updatePatientApi = (data: PatientParams) => request.put(`/patient/update`, data)